//
//  MainLineCell.m
//  TuYouAPP
//
//  Created by L on 14-2-18.
//
//

#import "MainLineCell.h"

@implementation MainLineCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}
-(void)updateUI:(NSString *)str lineTitle:(NSString *)linestr 
{
    
    CGSize constraint;
    //= CGSizeMak;e(150, CGFLOAT_MAX);
    CGSize size;
    //= [linestr sizeWithFont:[UIFont boldSystemFontOfSize:18] constrainedToSize:constraint lineBreakMode:NSLineBreakByWordWrapping];
    CGRect rect;
    //= self.lineTitle.frame;
//    rect.size.width = size.width+20;
//    self.lineTitle.frame = rect;
//    rect = self.lineBG.frame;
//    rect.size.width = size.width+20;
//    self.lineBG.frame =rect;
  //  self.lineTitle.center = self.lineBG.center;
//    if (!size.height<rect.size.width) {
//
//    }
    
    
    constraint = CGSizeMake(293, CGFLOAT_MAX);
     size = [str sizeWithFont:[UIFont systemFontOfSize:12] constrainedToSize:constraint lineBreakMode:NSLineBreakByWordWrapping];
    
    if (size.height < 29) {
        return;
    }
    if (size.height >40) {
        size.height = 40;
        size.width= 285;
    }
    rect = self.noticeLabel.frame;
    //rect.origin.y = 0;
    rect.size.height = size.height +5;
    self.noticeLabel.frame = rect;
    
   rect = self.noticeView.frame;
       //self.noticeLabel.text = str;
    rect.size.height  = size.height+10;
    rect.origin.y = 120 - size.height +10;
    self.noticeView.frame = rect;
    self.noticeBg.frame = self.noticeView.bounds;
    
    self.noticeLabel.center = self.noticeBg.center;
  //  rect = self.noticeBg.frame;
    
    
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
